

import SelectSubCompany from '@/components/Select/SelectSubCompany' // 分公司
import SelectProject from '@/components/Select/SelectProject' // 项目
import OrgTreeSelect from '@/components/OrgTreeSelect'

const searchOption = [
  {
    name: '所属单位',
    valueKey: 'searchQuery',
    type: OrgTreeSelect,
  },
    // {
    //     name: '分公司',
    //     // valueKey: 'branchComId',
    //     valueKey: 'branchCompanyId',
    //     value: '',
    //     type: SelectSubCompany
    // },
    // {
    //     name: '项目名称',
    //     valueKey: 'projectId',
    //     value: '',
    //     type: SelectProject
    // },
    {
        name: '是否重点项目',
        value: 'isKeyProject',
        type: 'select',
        data: [
            {
                value: 1,
                label: '是'
            },
            {
                value: 0,
                label: '否'
            }
        ]
    },
    {
        name: '状态',
        value: 'status',
        type: 'select',
        data: [
            {
                value: 0,
                label: '待提交'
            },
            {
                value: 1,
                label: '已提交'
            }
        ]
    },
]



// 定义表头
const columns = [
    {
        title: '序号',
        width: 65,
        scopedSlots: { customRender: 'serial' },
    },
    {
        title: '分公司',
        width: 150,
        dataIndex: 'branchName',
    },
    {
        title: '项目名称',
        width: 300,
        dataIndex: 'projectName',
    },
    {
        title: '是否重点项目',
        dataIndex: 'isKeyProject',
        width: 140,
        scopedSlots: { customRender: 'isKeyProject' },
    },
    {
        title: '编制人',
        width: 180,
        dataIndex: 'modifiedName',
    },
    {
        title: '编制时间',
        width: 120,
        dataIndex: 'modifiedTime',
    },
    {
        title: '状态',
        width: 140,
        dataIndex: 'status',
        scopedSlots: { customRender: 'status' },
    },
    {
        title: '已签收数量',
        width: 140,
        dataIndex: 'receivedQuantity'
    },
    {
        title: '操作',
        dataIndex: 'action',
        width: 150,
        // fixed: 'right',
        scopedSlots: { customRender: 'action' },
    },
]

const projectPlanningBasisColumns = [
    {
        title: '序号',
        width: 65,
        scopedSlots: { customRender: 'serial' },
    },
    {
        title: '项目前期工作事项',
        dataIndex: 'preProjectWork',
        scopedSlots: { customRender: 'preProjectWork' },
    },
    {
        title: '完成程度',
        width: 140,
        dataIndex: 'finishjob',
        scopedSlots: { customRender: 'finishjob' },
    },
    {
        title: '完成时间',
        width: 200,
        dataIndex: 'finishTime',
        scopedSlots: { customRender: 'finishTime' },
    },
    {
        title: '联系人',
        width: 200,
        dataIndex: 'contactName',
        scopedSlots: { customRender: 'contactName' },
    },
    {
        title: '联系方式',
        width: 200,
        dataIndex: 'contactPhone',
        scopedSlots: { customRender: 'contactPhone' },
    },
    {
        title: '操作',
        width: '200px',
        fixed: 'right',
        dataIndex: 'operation',
        scopedSlots: { customRender: 'operation' }
    },
]

const getGuid = () => {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = Math.random() * 16 | 0
        var v = c === 'x' ? r : (r & 0x3 | 0x8)
        return v.toString(16)
    })
}


const templateAddRow = {
    preProjectWork: '',
    finishjob: 0,
    finishTime: null,
    contactName: '',
    contactPhone: '',
    isDeleteButton: 1
}

// ==========策划工作安排==============


const planningWorkArrangementColumns = [
    {
        title: '序号',
        width: 65,
        scopedSlots: { customRender: 'serial' },
    },
    {
        title: '策划项目',
        width: 300,
        dataIndex: 'planProject'
    },
    {
        title: '要点',
        dataIndex: 'gist',
    },
    {
        title: '责任部门/责任人',
        width: 200,
        dataIndex: 'duty'
    },
    {
        title: '完成期限',
        width: 200,
        dataIndex: 'deadline',
        scopedSlots: { customRender: 'deadline' },
    },
    {
        title: '项目操作人',
        width: 200,
        dataIndex: 'projectOperatorId',
        scopedSlots: { customRender: 'projectOperatorId' },
    }
]

const planningWorkArrangementColumnsAdd = [
    {
        title: '签收时间',
        width: 120,
        dataIndex: 'signTime',
        scopedSlots: { customRender: 'signTime' }
    },
    {
        title: '实际完成时间',
        width: 120,
        dataIndex: 'actualCompleteTime',
        scopedSlots: { customRender: 'actualCompleteTime' }
    },
    {
        title: '版本信息',
        width: 150,
        dataIndex: 'version',
        scopedSlots: { customRender: 'version' }
    },
    {
        title: '状态',
        width: 100,
        dataIndex: 'status',
        scopedSlots: { customRender: 'status' }
    },
    {
        title: '当前节点',
        width: 150,
        dataIndex: 'node',
        scopedSlots: { customRender: 'node' }
    },
    {
        title: '操作',
        width: 150,
        fixed: 'right',
        dataIndex: 'operation',
        scopedSlots: { customRender: 'operation' }
    },
]





export { searchOption, columns, projectPlanningBasisColumns, templateAddRow, getGuid, planningWorkArrangementColumns, planningWorkArrangementColumnsAdd }
